{#include main fluid=true}

{#title}Testing{/title}

{#style}
    #testsInFooter {
        display: none;
    }
    #devUiFooterResizeButton {
        position: absolute;
        right: 50vw;
    }
    .main-container{
        margin-top: 0px !important;
    }
    .testsFooterButton i::after {
       font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
        font-weight: normal;
    }
    .btnTestsGuide i::after {
        content: " Guide";
    }
    .btnRerunAllTests i::after {
        content: " Run all";
    }
    .btnRerunFailedTests i::after {
        content: " Run failed";
    }
    .btnBrokenOnlyTests i::after {
        content: " Toggle broken only mode";
    }
    .btnPrintFailuresTests i::after {
        content: " Print failures";
    }
    .btnToggleTestOutput i::after{
        content: " Toggle test output";
    }
    .btnToggleInstrumentationBasedReload i::after {
        content: " Toggle instrumentation based reload";
    }
    .btnToggleLiveReload i::after {
        content: " Toggle live reload enabled";
    }
    .btnForceRestart i::after {
        content: " Force restart";
    }
    .btnTestsResults{
        display: none;
    }
    
{/style}

{#script}
    var testPageUrl = window.location.protocol + "//" + window.location.host + testsPathname.substr(0, testsPathname.indexOf('/dev/')) + "/dev/io.quarkus.quarkus-vertx-http/tests";
    document.addEventListener('messageReceived', function (e) {
        $.get(testPageUrl, function(response){
            var testsResultsSection = $(response).find("#testsResultsSection");
            $('#testsResultsSection').html(testsResultsSection);
        });
    }, false);
{/script}
{#body}

<div class="row p-1 bg-dark">
    {#include testsNav}{/include}    
</div>

<div id="testsResultsSection">

    {#for cn in info:tests.results.failing.orEmpty}
    <div class="row p-1">
        <div class="col-sm">
            <button class="btn btn-danger btn-block" type="button" data-toggle="collapse" data-target="#failedTests{cn_count}" aria-expanded="false" aria-controls="failedTests{cn_count}">
                <span class="float-left"><i class="fas fa-times-circle"></i> {cn.className}</span><span class="float-right">{cn.time}ms</span>
            </button>
            <div class="collapse" id="failedTests{cn_count}">
                <ul class="list-group">
                {#for r in cn.failing}
                    {#if r.test}
                    <li class="list-group-item">
  
                        <a class="btn btn-link btn-block text-danger" data-toggle="collapse" data-target="#failedTests{cn_count}LogFailed{r_count}" aria-expanded="false" aria-controls="failedTests{cn_count}LogFailed{r_count}">
                            <span class="float-left"><i class="fas fa-times-circle"></i> {r.displayName}</span><span class="float-right">{r.time}ms</span>
                        </a>

                        <div id="failedTests{cn_count}LogFailed{r_count}" class="collapse">
                            <br/>
                            <div class="bg-dark text-light p-2">
                                <samp class="text-wrap text-info" style="font-size: 0.9em;">
                                    {#for throwable in r.problems}
                                        <pre class="text-danger">{throwable.message}</pre>
                                        <br/>
                                        {#for frame in throwable.stackTrace}
                                        {frame} <br/>
                                        {/for}
                                    {/for}
                                </samp>
                            </div>
                            {#if !r.logOutput.empty}
                                <br/>
                                <div class="bg-dark text-light p-2">
                                    <samp class="text-wrap " style="font-size: 0.9em;">
                                        {#for log in r.logOutput}
                                            {log.raw} <br/>
                                        {/for}
                                    </samp>
                                </div>
                            {/if}
                        </div>
                    </li>
                    {/if}
                {/for}
                
                {#for r in cn.passing}
                    {#if r.test}
                    <li class="list-group-item">
  
                        <a class="btn btn-link btn-block text-success" data-toggle="collapse" data-target="#failedTests{cn_count}LogPassed{r_count}" aria-expanded="false" aria-controls="failedTests{cn_count}LogPassed{r_count}">
                            <span class="float-left"><i class="fas fa-check-circle"></i> {r.displayName}</span><span class="float-right">{r.time}ms</span>
                        </a>
                    
                        <div id="failedTests{cn_count}LogPassed{r_count}" class="collapse">
                            {#if !r.logOutput.empty}
                                <br/>
                                <div class="bg-dark text-light p-2">
                                    <samp class="text-wrap " style="font-size: 0.9em;">
                                        {#for log in r.logOutput}
                                            {log.raw} <br/>
                                        {/for}
                                    </samp>
                                </div>
                            {/if}
                        </div>
                    </li>
                    {/if}
                {/for}    

                {#for r in cn.skipped}
                    {#if r.test}
                    <li class="list-group-item">
  
                        <a class="btn btn-link btn-block text-secondary" data-toggle="collapse" data-target="#failedTests{cn_count}LogSkipped{r_count}" aria-expanded="false" aria-controls="failedTests{cn_count}LogSkipped{r_count}">
                            <span class="float-left"><i class="fas fa-minus-circle"></i> {r.displayName}</span><span class="float-right">{r.time}ms</span>
                        </a>
                        
                    
                        <div id="failedTests{cn_count}LogSkipped{r_count}" class="collapse">
                            {#if !r.logOutput.empty}
                                <br/>
                                <div class="bg-dark text-light p-2">
                                    <samp class="text-wrap " style="font-size: 0.9em;">
                                        {#for log in r.logOutput}
                                            {log.raw} <br/>
                                        {/for}
                                    </samp>
                                </div>
                            {/if}
                        </div>
                    </li>
                    
                    {/if}
                {/for} 
                </ul>    
            </div>
        </div>
    </div>
    {/for}
    
    
    {#for cn in info:tests.results.passing.orEmpty}
    
    <div class="row p-1">
        <div class="col-sm">
            <button class="btn btn-success btn-block" type="button" data-toggle="collapse" data-target="#passedTests{cn_count}" aria-expanded="false" aria-controls="passedTests{cn_count}">
                <span class="float-left"><i class="fas fa-check-circle"></i> {cn.className}</span><span class="float-right">{cn.time}ms</span>
            </button>
            <div class="collapse" id="passedTests{cn_count}">
                <ul class="list-group">
                {#for r in cn.passing}
                    {#if r.test}
                    <li class="list-group-item">
  
                            <span class="float-left"><i class="fas fa-check-circle"></i> {r.displayName}</span><span class="float-right">{r.time}ms</span>
                        </a>
                        
                    
                        <div id="passedTests{cn_count}LogPassed{r_count}" class="collapse">
                            <br/>
                            <div class="bg-dark text-light p-2">
                                <samp class="text-wrap " style="font-size: 0.9em;">
                                    {#for log in r.logOutput}
                                        {log.raw} <br/>
                                    {/for}
                                </samp>
                            </div>
                        </div>
                    </li>
                    {/if}
                {/for}    

                {#for r in cn.skipped}
                    {#if r.test}
                    <li class="list-group-item">
  
                        <a class="btn btn-link btn-block text-secondary" data-toggle="collapse" data-target="#passedTests{cn_count}LogSkipped{r_count}" aria-expanded="false" aria-controls="passedTests{cn_count}LogSkipped{r_count}">
                            <span class="float-left"><i class="fas fa-minus-circle"></i> {r.displayName}</span><span class="float-right">{r.time}ms</span>
                        </a>
                        
                    
                        <div id="passedTests{cn_count}LogSkipped{r_count}" class="collapse">
                            <br/>
                            <div class="bg-dark text-light p-2">
                                <samp class="text-wrap " style="font-size: 0.9em;">
                                    {#for log in r.logOutput}
                                        {log.raw} <br/>
                                    {/for}
                                </samp>
                            </div>
                        </div>
                    </li>
                    
                    {/if}
                {/for} 
                </ul>    
            </div>
        </div>
    </div>
    {/for}
    
    
    {#for cn in info:tests.results.skipped.orEmpty}
    <div class="row p-1">
        <div class="col-sm">
            <button class="btn btn-secondary btn-block" type="button" data-toggle="collapse" data-target="#skippedTests{cn_count}" aria-expanded="false" aria-controls="skippedTests{cn_count}">
                <span class="float-left"><i class="fas fa-minus-circle"></i> {cn.className}</span><span class="float-right">{cn.time}ms</span>
            </button>
            <div class="collapse" id="skippedTests{cn_count}">
                <ul class="list-group">
                
                {#for r in cn.skipped}
                    {#if r.test}
                    <li class="list-group-item">
  
                        <a class="btn btn-link btn-block text-secondary" data-toggle="collapse" data-target="#skippedTests{cn_count}LogSkipped{r_count}" aria-expanded="false" aria-controls="skippedTests{cn_count}LogSkipped{r_count}">
                            <span class="float-left"><i class="fas fa-minus-circle"></i> {r.displayName}</span><span class="float-right">{r.time}ms</span>
                        </a>
                        
                    
                        <div id="skippedTests{cn_count}LogSkipped{r_count}" class="collapse">
                            <br/>
                            <div class="bg-dark text-light p-2">
                                <samp class="text-wrap " style="font-size: 0.9em;">
                                    {#for log in r.logOutput}
                                        {log.raw} <br/>
                                    {/for}
                                </samp>
                            </div>
                        </div>
                    </li>
                    
                    {/if}
                {/for} 
                </ul>    
            </div>
        </div>
    </div>
    {/for}
</div>
{/body}
{/include}
